<template>
  <div>
    <div class="father">
      <p>father</p>
      <br />
      <br />
      <hr />
      <son name="小白哦" :age="7" :person="person" @myevent="getevent"></son>
    </div>
  </div>
</template>
<script>
import son from './son'
export default {
  components: {
    son
  },
  data () {
    return {
      // 如果传的是一个对象要绑定
      person: {
        name: '小黑',
        adress: '也在唱山歌幽'
      }
    }
  },
  methods: {
    //   固定写法getevent(val){}
    getevent (val) {
      console.log('父组件接收的值', val)
    }
  }
}
</script>
<style lang="less">
.father {
  width: 400px;
  height: 400px;
  border: 1px solid #000;
  background-color: red;
}
</style>
